package com.java.array;

public class Main {
    public static void main(String[] args) {
        //练习1：定义二维数组，用来保存3个班的5个同学，
        // 输入3个班的五个名字（需要用大Scanner）
        String[][] names = new String[3][5];
        for (int i = 0; i < names.length; i++) {
            for (int j = 0; j < names[i].length; j++) {
                System.out.println("请输入第" + (i + 1) + "个班第" + (j + 1) + "个同学的名字：");
                names[i][j] = new java.util.Scanner(System.in).next();
            }
        }
        for (int i = 0; i < names.length; i++) {
            for (int j = 0; j < names[i].length; j++) {
                System.out.println("第" + (i + 1) + "个班第" + (j + 1) + "个同学的名字为：" + names[i][j]);
            }
        }

    }
}
